package com.gzhryc.shared_device.common.payment.dao.db;

import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.JoinField;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.shared_device.common.payment.dao.enums.WXPayConfigEnum;

import java.util.Date;

/**
 * 微信支付配置
 */
@Table(name="payment_wx_pay_config")
public class WXPayConfig {

    @Id(auto = false)
    @Column(name = "app_id")
    protected String appId;

    @Column(name = "app_secret", length = 64)
    protected String appSecret;

    @Column(name = "app_type",notNull = true,note = "应用类型")
    protected Integer appType;

    @Column(name = "mch_id", length = 64, note = "支付账号")
    protected String mchId;

    @Column(name = "pay_key", length = 64,note = "支付密钥")
    protected String payKey;

    @Column(name = "pre_auth_service_id", length = 64,note = "免押服务ID")
    protected String preAuthServiceId;

    @Column(name = "api_v3_key", length = 64,note = "V3支付密钥")
    protected String apiV3Key;

    @Column(name = "certificate_path", length = 64,note = "证书路径")
    protected String certificatePath;

    @Column(name = "certificate_serial_no", length = 64,note = "证书序列号")
    protected String certificateSerialNo;

    @Column(name = "certificate_pwd",note = "证书的密码")
    protected String certificatePwd;

    @Column(name = "rsa_public_key", length = 512, note = "RSA公钥")
    protected String rsaPublicKey;

    @Column(name = "account_group_id", note = "账号组ID")
    protected Long accountGroupId;

    @Column(length = 64, note = "简介")
    protected String note;

    @Column(name = "token_type",notNull = true,defVal = "1",note = "Token类型")
    protected Integer tokenType;

    @Column(name = "token_config_json", type = "TEXT", note = "Token配置信息")
    protected String tokenConfigJson;
    
    @Column(notNull = true,defVal = "1",note = "状态")
    protected Integer state;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @JoinField(name="name",fromField = "account_group_id",toTable = "payment_account_group",type = "LEFT")
    protected String accountGroupName;


    //==未启用==

    @Column(name = "original_id", note = "原始Id")
    protected String originalId;

    @Column(name = "server_app_id", note = "服务商APPID")
    protected String serverAppId;

    @Column(name = "server_mch_id", note = "服务商商户号")
    protected String serverMchId;



    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    public Integer getAppType() {
        return appType;
    }

    public void setAppType(Integer appType) {
        this.appType = appType;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getPayKey() {
        return payKey;
    }

    public void setPayKey(String payKey) {
        this.payKey = payKey;
    }

    public String getPreAuthServiceId() {
        return preAuthServiceId;
    }

    public void setPreAuthServiceId(String preAuthServiceId) {
        this.preAuthServiceId = preAuthServiceId;
    }

    public String getApiV3Key() {
        return apiV3Key;
    }

    public void setApiV3Key(String apiV3Key) {
        this.apiV3Key = apiV3Key;
    }

    public String getCertificatePath() {
        return certificatePath;
    }

    public void setCertificatePath(String certificatePath) {
        this.certificatePath = certificatePath;
    }

    public String getCertificateSerialNo() {
        return certificateSerialNo;
    }

    public void setCertificateSerialNo(String certificateSerialNo) {
        this.certificateSerialNo = certificateSerialNo;
    }

    public String getCertificatePwd() {
        return certificatePwd;
    }

    public void setCertificatePwd(String certificatePwd) {
        this.certificatePwd = certificatePwd;
    }

    public String getRsaPublicKey() {
        return rsaPublicKey;
    }

    public void setRsaPublicKey(String rsaPublicKey) {
        this.rsaPublicKey = rsaPublicKey;
    }

    public Long getAccountGroupId() {
        return accountGroupId;
    }

    public void setAccountGroupId(Long accountGroupId) {
        this.accountGroupId = accountGroupId;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Integer getTokenType() {
        return tokenType;
    }

    public void setTokenType(Integer tokenType) {
        this.tokenType = tokenType;
    }

    public String getTokenConfigJson() {
        return tokenConfigJson;
    }

    public void setTokenConfigJson(String tokenConfigJson) {
        this.tokenConfigJson = tokenConfigJson;
    }

    public String getOriginalId() {
        return originalId;
    }

    public void setOriginalId(String originalId) {
        this.originalId = originalId;
    }

    public String getServerAppId() {
        return serverAppId;
    }

    public void setServerAppId(String serverAppId) {
        this.serverAppId = serverAppId;
    }

    public String getServerMchId() {
        return serverMchId;
    }

    public void setServerMchId(String serverMchId) {
        this.serverMchId = serverMchId;
    }

    public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getAppTypeName(){
        return WXPayConfigEnum.AppType.note(this.appType);
    }
    
    public String getStateName(){
        return WXPayConfigEnum.State.note(this.state);
    }


    public String getAccountGroupName() {
        return accountGroupName;
    }

    public void setAccountGroupName(String accountGroupName) {
        this.accountGroupName = accountGroupName;
    }
}
